<!DOCTYPE html>
<html class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="__ADMIN__/css/font.css">
<link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
<script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
<script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
<script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
{include file="public/layui" /}
<style>
	.layui-btn+.layui-btn{
    margin-left: 0;
}
</style>
</head>

<body>
<div class="x-body x-admin">
	<div class="layui-table-body layui-table-main" style="width: 100%;">
		<table class="layui-table layui-form" id="assessment"></table>
	</div>
	<div class="layui-table-body layui-table-main" style="width: 100%;">
		<table class="layui-table layui-form">
		    <thead>
		        <tr>
		            <td>录入客户数</td>
                    <td>签单客户数</td>
                    <td>活动开启数</td>
                    <td>已报业绩</td>
                    {if $result.final_score}
                    <td>得分</td>
                    {/if}
                    {if $result.max_score}
                    <td>总分</td>
                    {/if}
                    {if $result.merit_pay && $result.final_score}
                    <td>绩效工资</td>
                    {/if}
		        </tr>
		    </thead>
		    <tbody>
		        <tr>
		            <td>{$clientCount}</td>
		            <td>{$qdCount}</td>
		            <td>{$performanceData.count}</td>
		            <td>{$performanceData.sum}</td>
                    {if $result.final_score}
                    <td>{$result.final_score}</td>
                    {/if}
                    {if $result.max_score}
                    <td>{$result.max_score}</td>
                    {/if}
                    {if $result.merit_pay && $result.final_score}
                    <td>{$result.merit_pay * $result.final_score / $result.max_score} ({$result.merit_pay})</td>
                    {/if}
		        </tr>
		    </tbody>
		</table>
	</div>
	
</div>
<script type="text/html" id="toolbarDemo">

</script> 

<script>
layui.use(['form','layer','jquery','table','util'], function(){
    form = layui.form,
    layer = layui.layer
    ,$ = layui.jquery
    ,table = layui.table
    ,util = layui.util;
    
    
    table.render({
        elem: '#assessment',
        url:'{:url('assessmentSalesman/scoreList')}?limit=999&id={$_GET['id']}&admin_id={$_GET['admin_id']}&job_id={$_GET['job_id']}', 
        toolbar: '#toolbarDemo',
        defaultToolbar: ['filter', 'exports', 'print', {
          title: '提示',
          layEvent: 'LAYTABLE_TIPS',
          icon: 'layui-icon-tips'
        }],
        //height: $(window).height() - 200,
        cellMinWidth: 80,
        totalRow: true, 
        limis: 9999,
        page: false,
        cols: [function(){
            var arr = [
                {field:'item_name', title:'考核项目',  width:150, totalRowText: '合计'},
                {if $typeCheck}
                {field:'type_name', title:'维度',  width:60},
                {/if}
                {field:'max_score', title:'项目满分', width:90},
                {field:'index_desc', title:'指标要求', width:90},
                {field:'rule_desc', title:'评分规则'},
                {field:'self_score', title:'自评', width:90,totalRow: true},
                {field:'final_score', title:'上级', width:90,totalRow: true},
            ];
            
            // 初始化筛选状态
            var local = layui.data('table-filter-assessment22222222222'); 
            layui.each(arr, function(index, item){
                if(item.field in local){
                    item.hide = local[item.field];
                }
            });
            return arr;
        }() ],  
        done: function(){
            // 记录筛选状态
            var that = this;
            that.elem.next().on('mousedown', 'input[lay-filter="LAY_TABLE_TOOL_COLS"]+', function(){
                var input = $(this).prev()[0];
                // 此处表名可任意定义
                layui.data('table-filter-assessment22222222222', {
                    key: input.name
                    ,value: input.checked
                })
            });
        }
    });
});

</script>
</body>

</html>